home *** CD-ROM | disk | FTP | other *** search
/ APDL Eductation Resources / APDL Eductation Resources.iso / programs / electronic / rlab / TestMatrix / seqa_r < prev    next >
Encoding:
Text File  |  1994-05-18  |  704 b   |  30 lines

  1. //-------------------------------------------------------------------//
  2.  
  3. // Synopsis:  Additive sequence.
  4.  
  5. // Syntax:    seqa ( A , B , N )
  6.  
  7. // Description:
  8.  
  9. //    Produces a row vector comprising N equally spaced numbers
  10. //    starting at A and finishing at B. If N is omitted then 10
  11. //    points are generated. 
  12.  
  13. //    This file is a translation of seqa.m from version 2.0 of 
  14. //    "The Test Matrix Toolbox for Matlab", described in Numerical
  15. //    Analysis Report No. 237, December 1993, by N. J. Higham.
  16.  
  17. //-------------------------------------------------------------------//
  18.  
  19. seqa = function ( a , b , n )
  20. {
  21.   if (!exist(n)) { n = 10; }
  22.  
  23.   if (n <= 1)
  24.   {
  25.     return [a];
  26.   }
  27.  
  28.   return [a+(0:n-2)*(b-a)/(n-1), b];
  29. };
  30.